// @charset "utf-8";
define(function (require, exports, module) {
(async()=>{ 
	try {
		commonMethod.init();

		var resetSizeFun = require('../base/resetsizeqrpj');
		resetSizeFun.init();

		var autoLoop = require('../base/autoloop');

		interactions.commonEvents();

		var qrpjView = require('./qrpjview');
		qrpjView.init();
		var dqfxView = require('./dqfxview');
		dqfxView.init();

		autoLoop.autodo(function (isIn) {
			qrpjView.autoRefresh(isIn);
			dqfxView.autoRefresh(isIn);
		}, 20000, function (date) {
			tradingDay = date;
			if (qrpjView.param.period == 'min') {
				qrpjView.param.begin = date;
			}
			$('#view_input_qrpjdate').val(commonMethod.dateSplit(date));
			qrpjView.requestData();
			interactions.renderRisingProb('qrpjhc', 'NUL');
		});

		var switchTabCallback =async  function (index) {
			if (index == 1) {
				dqfxView.requestData();
			} else {
				var isToday = qrpjView.param.begin == await commonMethod.serverTime();
				var isTrade = commonMethod.thsQuote.isTradeTime('1A0001');
				if (qrpjView.param.period == 'min' && isTrade && isToday) {
					qrpjView.requestData();
				}
			}
		};
		await interactions.switchTab(switchTabCallback);

		$('.view_i_zdfselect').on('click', function (e) {
			e = event || window.event;
			if (e && e.stopPropagation) {
				e.stopPropagation();
			} else {
				e.cancelBubble = true;
			}
			$(this).parents('.view_div_dqfxitem').siblings('.view_div_dqfxitem').find('.view_ul_selectbox').addClass('hide');
			$(this).parents('.view_div_dqfxitem').find('.view_ul_selectbox').toggleClass('hide');
			TA.log($(this).attr('data-stat'));
		});
		$('body').not('.view_i_zdfselect').on('click', function() {
			setTimeout(function() {
				$('.view_ul_selectbox').addClass('hide');
			}, 150);
		});
		TA.log('cop_56d3b79c_317');
	} catch (e) {
		// alert('qrpjinit'+e.message);
	}
})();
});
